﻿using System;
using System.Collections.Generic;
using System.Text;
namespace IDotNet.MapLibs
{
    public partial class MapLibConfig
    {
        protected const string ConfigRoot = "MapLibConfig.";

        public static class BMap
        {
            private const string MapType = "BMap.";

            public static string GeocodingUri
            {
                get
                {
                    return MapLibHelper.GetAppConfigValue(ConfigRoot + MapType + "GeocodingUri") ?? "http://api.map.baidu.com/geocoder/v2/";
                }
            }

            public static string SuggestionUri
            {
                get
                {
                    return MapLibHelper.GetAppConfigValue(ConfigRoot + MapType + "SuggestionUri") ?? "http://api.map.baidu.com/place/v2/Suggestion/";
                }
            }

            public static string GeocodingAk
            {
                get
                {
                    return MapLibHelper.GetAppConfigValue(ConfigRoot + MapType + "Ak").ThrowExceptionIfNullOrEmpty();
                }
            }

        }

        public static class BingMap
        {
            private const string MapType = "BingMap.";

            public static string GeocodingUri
            {
                get
                {
                    return MapLibHelper.GetAppConfigValue(ConfigRoot + MapType + "GeocodingUri") ?? "http://api.map.baidu.com/geocoder/v2/";
                }
            }

            public static string SuggestionUri
            {
                get
                {
                    return MapLibHelper.GetAppConfigValue(ConfigRoot + MapType + "SuggestionUri") ?? "http://api.map.baidu.com/place/v2/Suggestion/";
                }
            }

            public static string GeocodingAk
            {
                get
                {
                    return MapLibHelper.GetAppConfigValue(ConfigRoot + MapType + "Ak").ThrowExceptionIfNullOrEmpty();
                }
            }
        }
    }
}
